//
//  XDUserAccountModel.swift
//  weibo
//
//  Created by lucy on 2016/10/25.
//  Copyright © 2016年 com.huashengHuaSheng. All rights reserved.
//

import UIKit
import YYModel

class XDUserAccountModel: NSObject, NSCoding {
    //用户授权唯一票据
    var access_token: String?
    var expires_in: TimeInterval = 0{
        didSet{
        
            expires_Date = Date().addingTimeInterval(expires_in)
        
        }

    }
    var expires_Date : Date?
    var uid: String?
    var avatar_large: String?
    //昵称
    var screen_name: String?
    
    override init(){
    
        super.init()
    }
    
    //归档
    func encode(with aCoder: NSCoder) {
        self.yy_modelEncode(with: aCoder)
    }
    
    //解档
    required init?(coder aDecoder: NSCoder) {
        super.init()
        self.yy_modelInit(with: aDecoder)
    }
    
    //重写description方法
    override var description: String{
        let keys = ["access_token", "expires_Date", "uid", "avatar_large", "screen_name"];
        
        return dictionaryWithValues(forKeys: keys).description
    
    }
    
}





































